﻿@using thousandClear.Areas.Admin.Models;

@model List<UserModel>


@{
    ViewBag.Title = "用户管理";
    Layout = "~/Areas/Admin/Views/Shared/_Admin.cshtml";
}

<div id="app">
    <div class="am-cf am-padding">
        <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">后台管理</strong> / <small>@ViewBag.Title</small></div>
    </div>

    <div class="am-g">
        <div class="am-u-sm-12 am-u-md-6">
            <div class="am-btn-toolbar">
                <div class="am-btn-group am-btn-group-xs">
                    @if (ViewBag.level != "2")
                    {
                        <a href="~/admin/user/add" class="am-btn am-btn-primary"><span class="am-icon-plus"></span> 新增用户</a>
                    }
                </div>
            </div>
        </div>

        <div class="am-g">
            <div class="am-u-sm-12">
                <table class="am-table am-table-striped am-table-hover table-main">
                    <thead>
                        <tr>
                            <th>用户ID</th>
                            <th>账号</th>
                            <th>创建时间</th>
                            <th>操作</th>
                        </tr>
                    </thead>
                    <tbody>
                        @foreach (UserModel item in Model)
                        {
                            <tr>
                                <td>@item.OUID</td>
                                <td>@item.ouAccount</td>
                                <td>@item.CreatedDate</td>
                                <td>
                                    <div class="am-btn-toolbar">
                                        <div class="am-btn-group am-btn-group-xs">
                                            @if (ViewBag.level != "2")
                                            {
                                                <a href="~/admin/user/edit/@item.OUID" class="am-btn am-btn-primary am-btn-xs am-hide-sm-only"><span class="am-icon-trash-o"></span> 修改</a>
                                            }
                                        </div>
                                    </div>
                                </td>
                            </tr>
                        }
                    </tbody>
                </table>
                <div class="am-cf">
                    &nbsp;&nbsp;共 @ViewBag.TotalCount 条记录, 每页 @ViewBag.PageCount 条记录
                    <div class="am-fr">
                        <ul class="am-pagination">
                            <li><a href="@ViewBag.PrevPageUrl">&laquo; Prev</a></li>
                            <li><span>@ViewBag.CurrentPage/@ViewBag.TotalPage</span></li>
                            <li><a href="@ViewBag.NextPageUrl">Next &raquo;</a></li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

@section Scripts{
    <script>
        $('.admin-sidebar-user').addClass('current');
    </script>
}